package panda.query.struct;

public class IntConstant implements Constant{
	
	Integer value;
	
	public IntConstant(int value) {
		this.value = value;
	}

	public Object getContentValue() {
		return value;
	}

	public int compareTo(Constant o) {
		if (o instanceof NullConstant) return -Integer.MAX_VALUE;

		return value.compareTo(((IntConstant) o).value);
	}

	@Override
	public boolean getBooleanValue() {
		return value != 0;
	}

	@Override
	public float getFloatValue() {
		return value.floatValue();
	}

	@Override
	public int getIntValue() {
		return value;
	}

	@Override
	public String getStringValue() {
		return value.toString();
	}

}
